package com.kang.task;

import com.kang.listener.PlayListener;
import com.kang.service.warMap.CityService;
import lombok.extern.slf4j.Slf4j;
import love.forte.common.ioc.annotation.Beans;
import love.forte.simbot.timer.EnableTimeTask;
import love.forte.simbot.timer.Fixed;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.concurrent.TimeUnit;

/**
 * @program: service
 * @description: 定时任务类
 * @author: K.faWu
 * @create: 2022-06-09 17:04
 **/
@Beans
@Slf4j
@EnableTimeTask
@Component
public class BotTask {

    @Autowired
    private PlayListener playListener;

    /**
     * 每十分钟刷新一次物资
     */
    @Fixed(value = 10, timeUnit = TimeUnit.MINUTES)
    public void refresh() {
        //获取所有的领主信息，得到人口数量以及每类工种数量
        playListener.refresh();
    }
}
